package com.iwop.moto.service.impl;

import com.iwop.moto.model.MWithdraw;
import com.iwop.moto.model.SuperRecordModel;
import com.iwop.moto.service.BaseService;
import com.iwop.moto.service.MWithdrawService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by mobom on 2016/9/30.
 */
@Service
public class MWithdrawServiceImpl extends BaseService implements MWithdrawService {

    @Override
    public void insertWMithdrawService(MWithdraw mWithdraw) {
        getSqlSession().insert("MWithdrawMapper.insert",mWithdraw);
    }

    @Override
    public MWithdraw getMWithdrawServiceBySid(String sid) {
        MWithdraw mWithdraw = getSqlSession().selectOne("MWithdrawMapper.select", sid);
        return mWithdraw;
    }

    @Override
    public void editWMithdrawService(MWithdraw mWithdraw) {
        getSqlSession().update("MWithdrawMapper.update", mWithdraw);
    }

    @Override
    public List<MWithdraw> getMWithdrawServiceList(SuperRecordModel SRModel) {
        List<MWithdraw> mWithdraw = getSqlSession().selectList("MWithdrawMapper.selectMWithdrawServiceList", SRModel);
        return mWithdraw;
    }

    /**
     * @功能: 根据审核状态查询审核列表
     * @日期: liuwb by 2016-11-13 09:59 create
     * @return
     */
    @Override
    public List<SuperRecordModel> findWithdrawByStatus(SuperRecordModel SRModel){
        return getSqlSession().selectList("MWithdrawMapper.findWithdrawByStatus",SRModel);
    }

    /**
     * @功能: 根据主键(sid)更新审核状态
     * @日期: liuwb by 2016-11-13 09:55 create
     * @参数: sid 主键
     * @参数: auditStatus 修改的审核状态
     */
    @Override
    public void updateWithdrawAuditStatus (SuperRecordModel SRModel){
         getSqlSession().update("MWithdrawMapper.updateWithdrawAuditStatus",SRModel);
    }

    @Override
    public SuperRecordModel findWithDrawBySid(String pid) {
        return getSqlSession().selectOne("MWithdrawMapper.findWithDrawBySid", pid);
    }

    /**
     * @功能: 导出审核状态通过数据
     * @日期: dongmq by 2017-02-20 16:59 create
     * @return
     */
    @Override
    public List<SuperRecordModel> findWithdrawexport(SuperRecordModel SRModel){
        return getSqlSession().selectList("MWithdrawMapper.findWithdrawexport",SRModel);
    }

    /**
     * @功能: 批量代付在民生银行提交以后 修改代付通过
     * @日期: dongmq by 2017-02-23 9:30 create
     * @return
     */
    @Override
    public void updatBatchAuditStatus (SuperRecordModel SRModel){
        getSqlSession().update("MWithdrawMapper.updateBatchAuditStatus",SRModel);
    }
    /**
     * @功能: 标记批量导出状态
     * @日期: dongmq by 2017-02-31 9:30 create
     * @return
     */
    @Override
    public void updatBatchexport (SuperRecordModel SRModel){
        getSqlSession().update("MWithdrawMapper.updatBatchexport",SRModel);
    }

}

